package service

import (
	sqlc "bgs/db/sqlc"
)

func (s *BrandServiceImp) MapBrandDistributeWarehouseEntityToPtr(list []sqlc.BrandDistributeWarehouse) []*sqlc.BrandDistributeWarehouse {
	ptrs := make([]*sqlc.BrandDistributeWarehouse, len(list))
	for i := range list {
		ptrs[i] = &list[i]
	}
	return ptrs
}

func (s *BrandServiceImp) MapBrandDistributeWarehousePtrsToWarehouseIDs(ptrs []*sqlc.BrandDistributeWarehouse) (r []int64) {
	for _, ptr := range ptrs {
		r = append(r, ptr.WarehouseID)
	}
	return
}

func (s *BrandServiceImp) MapBrandDistributeProductPtrsTo(list []sqlc.BrandDistributeProduct) []*sqlc.BrandDistributeProduct {
	ptrs := make([]*sqlc.BrandDistributeProduct, len(list))
	for i := range list {
		ptrs[i] = &list[i]
	}
	return ptrs
}
